﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Polenter.Serialization;

namespace LMSGridLibrary
{
    public abstract class RunnableGridApplication
    {
        //public static RunnableGridApplication Instance
        //{
        //    get { return Nested.instance; }
        //}

        //class Nested
        //{
        //    // Explicit static constructor to tell C# compiler
        //    // not to mark type as beforefieldinit
        //    static Nested()
        //    {
        //    }
        //    internal static readonly RunnableGridApplication instance = new RunnableGridApplication();
        //}

        //public abstract RunnableGridApplication(){}

        public string ApplicationName;
        /// <summary>
        /// Value between 0-1 of processor usage
        /// </summary>
        public float MaxProcessorUse;

        public abstract void Initialize();
        public abstract void Start();
        public abstract void Pause();
        public abstract void Resume();
        public abstract void Stop();
        public abstract void SaveState();
        //{
           // SharpSerializerXmlSettings settings =  new SharpSerializerXmlSettings();
           // SharpSerializer serializer = new SharpSerializer( new SharpSerializerXmlSettings());
            //serializer.Serialize(this,ApplicationName + ".xml");
        //}
        public abstract object LoadState();
        //{
        //    SharpSerializerXmlSettings settings = new SharpSerializerXmlSettings();
        //    SharpSerializer serializer = new SharpSerializer(new SharpSerializerXmlSettings());
        //    return serializer.Deserialize(ApplicationName + ".xml");
        //}

        public abstract void SpeedUp();
        public abstract void SpeedDonw();
    }
}
